package com.example.demo.error;

public class StackOverFlowDemo {

    /**
     * -Xss2m 来调整栈的大小
     * @param i
     */
    public static void foo(int i) {
        try {
            foo(++i);
        } catch (Throwable e) {
            System.out.println(i);
//            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        foo(0);
    }

}
